package com.heshida.controller;

import com.heshida.po.Food;
import com.heshida.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/SearchController")
public class SearchController {
    @Autowired
    private SearchService searchService;

    @RequestMapping("/searchByKey")
    public List<Food> findBySearchKey(String searchKey){
        return searchService.findBySearchKey(searchKey);
    }
}
